package cn.wolfcode.feign;

import cn.wolfcode.common.web.Result;
import cn.wolfcode.domain.Product;
import cn.wolfcode.feign.fallback.ProductFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author LuoRis
 * @date 2021/03/05 19:07
 * @description 远程调用商品服务
 */
@FeignClient(name = "product-service",fallback = ProductFeignFallBack.class)
public interface ProductFeignApi {
    /**
     * 根据传过去的id集合查询得到Product集合
     * @param ids
     * @return
     */
    @RequestMapping("/product/queryProductByIds")
    Result<List<Product>> queryProductByIds(@RequestParam("ids")List<Long> ids);
}
